|
|
|
|
|
|
|
Printer Selection and Printer Setup |
|
|
|
|
|
|
|
|
The common dialog control is contained in ComDlg32.ocx. This OCX file wraps up the function calls to Commdlg.dll that must be in the Windows\System directory on your computer. |
|
|
|
|
|
|
|
|
Note that these dialog boxes dont open files, save files, or print anything. Instead, they allow the user to select filenames or fill in printer information. Its up to you to perform the opening of the file, the saving of the file, and the printing. You retrieve the properties from the dialog box and use them to perform a specific operation. |
|
|
|
|
|
|
|
|
Examples Filename: CommonDlg.frm |
|
|
|
|
|
|
|
|
Common Properties of the Common Dialog Control |
|
|
|
|
|
|
|
|
As is the case with most controls, you wont use all the properties of the common dialog control. In fact, the common dialog control has a lot of properties, because its used for so many different types of dialog boxes. Some properties deal only with the File Open dialog box, and you wont use them if youre calling the Printer Selection dialog box. Table 11.4 shows the properties most often changed and/or retrieved when using the common dialog control. |
|
|
|
|
| Table 11.4 Properties of the Common Dialog Control. | | Property | Description | | CancelError | If this property is set to True and the user clicks the dialog boxs Cancel button, the Visual Basic runtime error system is triggered. This allows you to trap when the user clicks the Cancel button instead of having to check to see whether value was filled in. | | Color | This property is filled in with a number that indicates the color selected by the user from the Color dialog box. |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|